@echo off
REM 将备份文件从 back 目录复制到上一级目录，覆盖同名文件

REM USB_DEVICE\Target\back --> USB_DEVICE\Target
xcopy "Q:\NewStart\sample\KPD_STM32F103C8T6\USB_DEVICE\Target\back\*.*" "Q:\NewStart\sample\KPD_STM32F103C8T6\USB_DEVICE\Target\" /Y /S

REM Middlewares\ST\STM32_USB_Device_Library\Core\Src\back --> Middlewares\ST\STM32_USB_Device_Library\Core\Src
xcopy "Q:\NewStart\sample\KPD_STM32F103C8T6\Middlewares\ST\STM32_USB_Device_Library\Core\Src\back\*.*" "Q:\NewStart\sample\KPD_STM32F103C8T6\Middlewares\ST\STM32_USB_Device_Library\Core\Src\" /Y /S

REM Middlewares\ST\STM32_USB_Device_Library\Class\CustomHID\Src\back --> Middlewares\ST\STM32_USB_Device_Library\Class\CustomHID\Src
xcopy "Q:\NewStart\sample\KPD_STM32F103C8T6\Middlewares\ST\STM32_USB_Device_Library\Class\CustomHID\Src\back\*.*" "Q:\NewStart\sample\KPD_STM32F103C8T6\Middlewares\ST\STM32_USB_Device_Library\Class\CustomHID\Src\" /Y /S

REM Middlewares\ST\STM32_USB_Device_Library\Class\CustomHID\Inc\back --> Middlewares\ST\STM32_USB_Device_Library\Class\CustomHID\Inc
xcopy "Q:\NewStart\sample\KPD_STM32F103C8T6\Middlewares\ST\STM32_USB_Device_Library\Class\CustomHID\Inc\back\*.*" "Q:\NewStart\sample\KPD_STM32F103C8T6\Middlewares\ST\STM32_USB_Device_Library\Class\CustomHID\Inc\" /Y /S

REM USB_DEVICE\App\back --> USB_DEVICE\App
xcopy "Q:\NewStart\sample\KPD_STM32F103C8T6\USB_DEVICE\App\back\*.*" "Q:\NewStart\sample\KPD_STM32F103C8T6\USB_DEVICE\App\" /Y /S

echo.
echo 备份文件恢复完成！
pause
